package com.woniuxy.project.campus;

import org.springframework.stereotype.Component;
import springfox.documentation.swagger.web.SwaggerResource;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;

import java.util.Arrays;
import java.util.List;

@Component
public class SwaggerResourceList implements SwaggerResourcesProvider {
    /**
     * 下拉列表里面的资源列表配置
     */
    @Override
    public List<SwaggerResource> get() {
        return Arrays.asList(
                createResource("/account/v2/api-docs","用户服务"),
                createResource("/canteen/v2/api-docs","商户服务"),
                createResource("/canteenOrder/v2/api-docs","食堂订单服务"),
                createResource("/technical/v2/api-docs","technical服务")


        );
    }

    private SwaggerResource createResource(String url,String name) {
        SwaggerResource sr = new SwaggerResource();
        sr.setLocation(url);
        sr.setName(name);
        sr.setSwaggerVersion("2.0");
        return sr;
    }
}